$OpenBSD: patch-plugins_node_d_openbsd_cpu_in,v 1.2 2012/10/12 09:46:46 kirby Exp $
--- plugins/node.d.openbsd/cpu.in.orig	Wed Oct  3 00:46:50 2012
+++ plugins/node.d.openbsd/cpu.in	Wed Oct 10 17:42:29 2012
@@ -35,12 +35,7 @@ fi
 
 if [ "$1" = "config" ]; then
 
-	OSV=`$SYSCTL_BIN -n kern.osrelease | cut -f1 -d.`
-	if [ "$OSV" = "4" ]; then
-		STATUNITS=`$SYSCTL_BIN -n kern.clockrate | cut -f16 -d' '`
-	elif [ "$OSV" -ge "5" ]; then
-		STATUNITS=`$SYSCTL_BIN -n kern.clockrate | cut -f13 -d' '`
-	fi
+	STATUNITS=`/sbin/sysctl -n kern.clockrate | cut -f15 -d' '`
 	PERCENT=`$SYSCTL_BIN -n hw.ncpu | awk '{print ($1)*100}'`
 	NCPU=`$SYSCTL_BIN -n hw.ncpu`
 	if [ "$scaleto100" = yes ]; then
@@ -104,5 +99,11 @@ if [ "$1" = "config" ]; then
 	exit 0
 fi
 
-$SYSCTL_BIN kern.cp_time | awk '{ print "user.value " $2 "\nnice.value " $3 "\nsystem.value " $4 "\ninterrupt.value " $5 "\nidle.value " $6 }'
+NCPU=$(/sbin/sysctl -n hw.ncpu)
+set -- $(/sbin/sysctl -n kern.cp_time | sed 's/,/ /g')
 
+echo user.value $(($1*NCPU))
+echo nice.value $(($2*NCPU))
+echo system.value $(($3*NCPU))
+echo interrupt.value $(($4*NCPU))
+echo idle.value $(($5*NCPU))
